{% extends 'dcim/devicetype/base.html' %}
{% load buttons %}
{% load helpers %}
{% load plugins %}

{% block content %}
    <div class="row">
        <div class="col col-md-6">
            <div class="card">
                <h5 class="card-header">
                    Chassis
                </h5>
                <div class="card-body">
                    <table class="table table-hover attr-table">
                        <tr>
                            <td>Manufacturer</td>
                            <td><a href="{{ object.manufacturer.get_absolute_url }}">{{ object.manufacturer }}</a></td>
                        </tr>
                        <tr>
                            <td>Model Name</td>
                            <td>
                                {{ object.model }}<br/>
                                <small class="text-muted">{{ object.slug }}</small>
                            </td>
                        </tr>
                        <tr>
                            <td>Part Number</td>
                            <td>{{ object.part_number|placeholder }}</td>
                        </tr>
                        <tr>
                            <td>Height (U)</td>
                            <td>{{ object.u_height }}</td>
                        </tr>
                        <tr>
                            <td>Full Depth</td>
                            <td>{% checkmark object.is_full_depth %}</td>
                        </tr>
                        <tr>
                            <td>Parent/Child</td>
                            <td>
                                {{ object.get_subdevice_role_display|placeholder }}
                            </td>
                        </tr>
                        <tr>
                            <td>Airflow</td>
                            <td>
                                {{ object.get_airflow_display|placeholder }}
                            </td>
                        </tr>
                        <tr>
                            <td>Front Image</td>
                            <td>
                                {% if object.front_image %}
                                    <a href="{{ object.front_image.url }}">
                                        <img src="{{ object.front_image.url }}" alt="{{ object.front_image.name }}" class="img-fluid" />
                                    </a>
                                {% else %}
                                    <span class="text-muted">&mdash;</span>
                                {% endif %}
                            </td>
                        </tr>
                        <tr>
                            <td>Rear Image</td>
                            <td>
                                {% if object.rear_image %}
                                    <a href="{{ object.rear_image.url }}">
                                        <img src="{{ object.rear_image.url }}" alt="{{ object.rear_image.name }}" class="img-fluid" />
                                    </a>
                                {% else %}
                                    <span class="text-muted">&mdash;</span>
                                {% endif %}
                            </td>
                        </tr>
                        <tr>
                            <td>Instances</td>
                            <td><a href="{% url 'dcim:device_list' %}?device_type_id={{ object.pk }}">{{ instance_count }}</a></td>
                        </tr>
                    </table>
                </div>
            </div>
            {% plugin_left_page object %}
        </div>
        <div class="col col-md-6">
            {% include 'inc/panels/custom_fields.html' %}
            {% include 'inc/panels/tags.html' %}
            {% include 'inc/panels/comments.html' %}
            {% plugin_right_page object %}
        </div>
    </div>
    <div class="row">
        <div class="col col-md-12">
            {% plugin_full_width_page object %}
        </div>
    </div>
{% endblock %}
